package chapter12

/**
  * @Copyright: Shanghai Definesys Company.All rights reserved.
  * @Description:
  * @author: chuhaitao
  * @since: 2019/1/17 21:58
  * @history:
  *          1.2019/1/17 created by chuhaitao
  */
object ViewDemo {

  def main(args: Array[String]): Unit = {

    var list1 = (0 to 100)

    var list2 = list1.filter((n: Int) => {
      n.toString.equals(n.toString.reverse)

    })

    println(list2)

      var list3 = list1.view.filter((n: Int) => {
      n.toString.equals(n.toString.reverse)

    })
    //打印不出来，使用了懒加载
    println(list3)
  }
}